package cn.xiaoliu.hrm.feign;

import cn.xiaoliu.hrm.domain.LoginUser;
import cn.xiaoliu.hrm.util.AjaxResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MyFallbackFactory implements FallbackFactory<ILoginUserFeignClient>{
    @Override
    public ILoginUserFeignClient create(Throwable throwable) {
        return new ILoginUserFeignClient() {
            @Override
            public AjaxResult entering(LoginUser loginUser) {
                return AjaxResult.me().setSuccess(false).setMessage("入驻失败，稍后重试");
            }
        };
    }
}
